home *** CD-ROM | disk | FTP | other *** search
/ Spiceworld The Movie - Interactive CD-ROM / Spiceworld The Movie: Interactive CD-ROM.iso / pc / elements / spicetwo.dir / scripts_1_main Scripts.ls < prev    next >
Encoding:
Text File  |  1997-12-04  |  4.0 KB  |  147 lines

  1. on startMovie
  2.   unloadMovie("spiceone.dir")
  3.   initialiseGame()
  4. end
  5.  
  6. on stopMovie
  7.   repeat with x = 1 to 48
  8.     set the visible of sprite x to 1
  9.     updateStage()
  10.   end repeat
  11.   clearGlobals()
  12. end
  13.  
  14. on initialiseGame
  15.   global PUZZLEPIECESDONE, BOARDPOS, LOOPFRAME, QUESTIONS, MOVIES, VIDVOLUME, score, STANDARDCURSOR, GAMESDONE, PRINTLIST, BOMBRATE, movieTime
  16.   set movieTime to 0
  17.   set BOMBRATE to random(2)
  18.   set PRINTLIST to EMPTY
  19.   set VIDVOLUME to 250
  20.   set LOOPFRAME to EMPTY
  21.   set PUZZLEPIECESDONE to 0
  22.   set BOARDPOS to 1
  23.   set score to 0
  24.   set GAMESDONE to 0
  25.   set QUESTIONS to "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17"
  26.   set MOVIES to EMPTY
  27.   set STANDARDCURSOR to -1
  28.   set the soundLevel to 6
  29.   repeat with x = 1 to the number of castMembers of castLib "QT video"
  30.     put x & "," after MOVIES
  31.   end repeat
  32.   delete char the number of chars in MOVIES of MOVIES
  33. end
  34.  
  35. on initialiseFrame
  36.   global LOOPFRAME, STANDARDCURSOR, BOMBRATE
  37.   set LOOPFRAME to the frameLabel
  38.   repeat with spriteNo = 1 to 120
  39.     set the visible of sprite spriteNo to 1
  40.   end repeat
  41.   if the memberNum of sprite 54 <> 0 then
  42.     set the movieRate of sprite 54 to BOMBRATE
  43.   end if
  44.   set the cursor of sprite 2 to 0
  45.   set the visible of sprite 52 to 0
  46.   set the visible of sprite 53 to 0
  47.   set the visible of sprite 71 to 0
  48.   set the visible of sprite 72 to 0
  49.   set the visible of sprite 90 to 0
  50.   set the visible of sprite 91 to 0
  51.   set the visible of sprite 92 to 0
  52.   updateStage()
  53.   cursor(STANDARDCURSOR)
  54. end
  55.  
  56. on checkRollOvers
  57.   set the visible of sprite 52 to rollOver(52)
  58.   set the visible of sprite 53 to rollOver(53)
  59.   updateStage()
  60.   if rollOver(53) then
  61.     set the memberNum of sprite 71 to the memberNum of sprite 71 + 1
  62.     set the visible of sprite 71 to 1
  63.     updateStage()
  64.     repeat while rollOver(53)
  65.     end repeat
  66.     set the visible of sprite 71 to 0
  67.     set the memberNum of sprite 71 to the memberNum of sprite 71 - 1
  68.     unLoad(member the name of member (the memberNum of sprite 71 + 1))
  69.   else
  70.     if rollOver(52) then
  71.       set the memberNum of sprite 72 to the memberNum of sprite 72 + 1
  72.       set the visible of sprite 72 to 1
  73.       updateStage()
  74.       repeat while rollOver(52)
  75.       end repeat
  76.       set the visible of sprite 72 to 0
  77.       set the memberNum of sprite 72 to the memberNum of sprite 72 - 1
  78.       unLoad(member the name of member (the memberNum of sprite 72 + 1))
  79.     end if
  80.   end if
  81.   updateStage()
  82. end
  83.  
  84. on doButton
  85.   set outBtnNo to the memberNum of sprite the clickOn
  86.   set inBtnNo to outBtnNo + 1
  87.   repeat while the mouseDown
  88.     if rollOver(the clickOn) then
  89.       set the memberNum of sprite the clickOn to inBtnNo
  90.     else
  91.       set the memberNum of sprite the clickOn to outBtnNo
  92.     end if
  93.     updateStage()
  94.   end repeat
  95.   set btnState to rollOver(the clickOn)
  96.   if btnState then
  97.     puppetSound("twink")
  98.   end if
  99.   set the memberNum of sprite the clickOn to outBtnNo
  100.   updateStage()
  101.   return btnState
  102. end
  103.  
  104. on returnToMainGame frameLabel
  105.   go("game board")
  106. end
  107.  
  108. on congratulations
  109.   startTimer()
  110.   setScore(50)
  111.   set the memberNum of sprite 90 to the memberNum of sprite 90 + 1
  112.   set the visible of sprite 90 to 1
  113.   set the visible of sprite 91 to 1
  114.   updateStage()
  115.   set the movieTime of sprite 91 to 0
  116.   set the movieRate of sprite 91 to 1
  117.   puppetSound("clapping")
  118.   repeat while the timer < 180
  119.     updateStage()
  120.   end repeat
  121.   set the movieTime of sprite 91 to 0
  122.   set the movieRate of sprite 91 to 0
  123.   set the visible of sprite 90 to 0
  124.   set the visible of sprite 91 to 0
  125.   set the memberNum of sprite 90 to the memberNum of sprite 90 - 1
  126.   updateStage()
  127.   unLoad(member the name of member (the memberNum of sprite 90 + 1))
  128. end
  129.  
  130. on setScore amount
  131.   global score
  132.   if amount <> VOID then
  133.     set score to amount + score
  134.   end if
  135.   set textScore to string(score)
  136.   repeat with x = 1 to 4
  137.     if the number of chars in textScore = 4 then
  138.       exit repeat
  139.     end if
  140.     put "0" before textScore
  141.   end repeat
  142.   repeat with x = 1 to 4
  143.     set the member of sprite (80 + x) to "score" && string(char x of textScore)
  144.   end repeat
  145.   updateStage()
  146. end
  147.